package com.nondo.dean.uniqueid;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "dean.unique_id", ignoreUnknownFields = false)
@ConditionalOnProperty(prefix = "dean.unique_id", name = {"worker_id", "data_center_id"}, matchIfMissing = true)
@PropertySource(value = {"classpath*:dean-uniqueid.yml", "classpath*:application.yml"})
public class UniqueIdProperties {

    private Long workerId = 1L;
    private Long dataCenterId = 1L;

    public Long getWorkerId() {
        return workerId;
    }

    public void setWorkerId(Long workerId) {
        this.workerId = workerId;
    }

    public Long getDataCenterId() {
        return dataCenterId;
    }

    public void setDataCenterId(Long dataCenterId) {
        this.dataCenterId = dataCenterId;
    }
}
